Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: Extend edit event options with createHistoryEntry flag #12

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

clepski
Copy link

@clepski clepski commented Nov 15, 2024

Feature

As a developer I want to be able to decide if an edit event creates a history entry or not. The flag createHistoryEntry defaults to true, because in most cases we want to create history entries.

Use case

In the open-scd distribution the Editor and History are separate addons and when redo, undo are triggered from the History addon it in turn dispatches edit events. When those edit events are consumed in the Editor addon we do not want to create any history entries.

History.ts

undo() {
  // ...
  const undoEdit = historyEntry.undo;
  this.host.dispatch(newEditEvent(undoEdit, { createHistoryEntry: false }));
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant